home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 13 / 013.d81 / dos #37 < prev    next >
Text File  |  2022-08-26  |  2KB  |  95 lines

  1. ======================================
  2.       DOS & Don'ts -- Part 37
  3.  
  4.       by James Gregory Weiler
  5. ======================================
  6.  
  7.           Part E: Files
  8.  
  9. ======================================
  10.  
  11. Section 1: seq & prg & usr files
  12.  
  13.  
  14.   These three file types are very
  15.  
  16. much alike, though they can be used to
  17.  
  18. store very different types of data.
  19.  
  20. Their similarity lies in the way they
  21.  
  22. are laid out on a disk.  See map 6,
  23.  
  24. quite a ways below.
  25.  
  26.   Each block of these files begins
  27.  
  28. with a two-byte track/block link to
  29.  
  30. the next block of the files, just like
  31.  
  32. the links we saw in the directory.
  33.  
  34.   The other 254 bytes in each block
  35.  
  36. just contain the file data, whatever
  37.  
  38. that may be... we're really not
  39.  
  40. interested in what that data is right
  41.  
  42. now, but here's the kind of stuff you
  43.  
  44. might find in each kind of file.
  45.  
  46.  SEQ - usually ASCII text.
  47.  USR - usually ASCII text.
  48.  PRG - usually a BASIC program.
  49.  PRG - often a machine code program.
  50.  PRG - sometimes ASCII text.
  51.  
  52.   Now, before we wrap up with relative
  53.  
  54. files, let's look at all the steps DOS
  55.  
  56. could have to go through to read a
  57.  
  58. five-block program file.
  59.  
  60.  a) Read BAM
  61.  b) Establish directory link (18,1).
  62.  c) Read directory (18,1).
  63.  d) Look for file name.
  64.       -- not found --
  65.  e) Establish directory link (18,4).
  66.  f) Read directory (18,4).
  67.  g) Look for file name.
  68.       -- found it --
  69.  h) Establish file link (21,6).
  70.  i) Read file block one (21,6).
  71.  j) Establish file link (21,9).
  72.  k) Read file block two (21,9).
  73.  l) Establish file link (21,12).
  74.  m) Read file block three (21,12).
  75.  n) Establish file link (21,15).
  76.  o) Read file block four (21,15).
  77.  p) Establish file link (21,18).
  78.  q) Read file block five (21,18).
  79.  r) End of file found. All done.
  80.  
  81. ======================================
  82. Map 6: Data block structure for all
  83.        file types: SEQ, USR, PRG & REL
  84. --------------------------------------
  85.  
  86. byte    contents
  87. ----    --------
  88. 0-1     File link: Track & block
  89.         number of next data block.
  90.  
  91. 2-256   File data
  92.  
  93.  
  94. =======< continued in Part 38 >=======
  95.